<?php

class Application_Model_ClientMapper
{
	protected $_dbTable;

	public function setDbTable ($dbTable) {
		if (is_string($dbTable))
		$dbTable = new $dbTable ();
		if (!$dbTable instanceof Zend_Db_Table_Abstract)
		throw new Exception ('Invalid table data gateway provided');
		$this->_dbTable = $dbTable;
		return $this;
	}
	public function getDbTable () {
		if (null === $this->_dbTable) {
			$this->setDbTable ('Application_Model_DbTable_Client');
		}
		return $this->_dbTable;
	}
	public function getRow($shopid){//从数据库按shopid查询数据
		$where = $this->getDbTable()->getAdapter()->quoteInto('id = ?', $shopid);
		$result = $this->getDbTable()->fetchAll($where);
		if (!empty($result)) {
		 return $result->toArray();
		} else {
		  return null;
		}
	}
}
?>